﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace WindowsGame2
{
    class Nodo
    {
        public String id;
        public String[] proximos;
        public int x;
        public int y;

        public Nodo(int _x, int _y)
        {
            x = _x;
            y = _y;
            proximos = new String[2];
            id = "";
            proximos[0] = "";
            proximos[1] = "";
        }

        public bool detectClick(int _x, int _y)
        {
            uint difX = (uint)(_x - x);
            uint difY = (uint)(_y - y);
            uint somaDosQuadrados = ((difX) * (difX)) + ((difY) * (difY));
            
            uint distance = (uint)(Math.Sqrt(somaDosQuadrados));
            if(distance < 10)
            {
                return true;
            }
            return false;
        }

        public void atualizaPosição(int _x, int _y)
        {
            x = _x;
            y = _y;
        }

        public void draw(SpriteBatch spriteBatch, Texture2D texture)
        {
            spriteBatch.Draw(texture, new Vector2(x, y), null, Color.Red, 1, new Vector2(10), 1f, SpriteEffects.None, 0);
        }
    }
}
